import { ACT } from "../../types/cartdemo"

interface d {
    data: Array<object>,
    [T: string]: string | Array<object>
}

const actionCreator: ACT<any> = (params) => (dispatch, getState, api) => {
    // console.log(params)
    // console.log(dispatch)
    // console.log(api)
    api.getProduct()
        .then((res: d) => {
            // console.log(res)
            dispatch({ type: params.type, payload: res.data })
        })
}


export default actionCreator
